/**
 * Created by wilson on 3/15/15.
 */
(function () {
    angular.module('app')
        .controller('suggestionController', suggestionController);

    suggestionController.$inject = ['$scope', 'userService', 'alertController'];
    function suggestionController($scope, userService, alertController) {
        $scope.submitSuggestion = submitSuggestion;

        function submitSuggestion() {
            userService.submitSuggestion($scope.suggestion).then(function (data) {
                alertController.simpleAlert(data.errMsg);
            }).catch(function (data) {
                alertController.simpleAlert(data.errMsg);
            });

        }
    }

})();